import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/Home/index.vue'
import Login from '@/views/Login/index.vue'
import Register from '@/views/Register/index.vue'
import Framework from '@/views/Framework/index.vue'
import Analysis from '@/views/Analysis/index.vue'
import Manage from '@/views/Manager/index.vue'
import UserManage from '@/views/Manager/userManage.vue'
import AlgorithmManage from '@/views/Manager/algorithmManage.vue'
import ModelManage from '@/views/Manager/modelManage.vue'

const routes = [
  {
    path: '/',
    redirect: '/home',
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
  },
  {
    path: '/login',
    name: 'Login',
    component: Login,
  },
  {
    path: '/register',
    name: 'Register',
    component: Register,
  },
  {
    path: '/framework',
    name: 'Framework',
    component: Framework,
  },
  {
    path: '/analysis',
    name: 'Analysis',
    component: Analysis,
  },
  {
    path: '/manage',
    name: 'Manage',
    component: Manage,
    children: [
      {
        path: 'user',
        name: 'UserManage',
        component: UserManage,
      },
      {
        path: 'algorithm',
        name: 'AlgorithmManage',
        component: AlgorithmManage,
      },
      {
        path: 'model',
        name: 'ModelManage',
        component: ModelManage,
      },
    ],
  },
]

const router = createRouter({
  history: createWebHistory(),
  routes,
})

export default router
